﻿@{
    Layout = null;
}
@using PermissionDesign.Model.Response;
@model PermissionDesign.Model.Response.ResponseModel
<!DOCTYPE html>
<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">
    <title>用户管理</title>

    @*1、Jquery组件引用*@
    <script src="~/Scripts/jquery-1.10.2.js"></script>
    @*2、bootstrap组件引用*@
    <script src="~/Content/bootstrap/bootstrap.js"></script>
    <link href="~/Content/bootstrap/bootstrap.css" rel="stylesheet" />

    @*3、bootstrap table组件以及中文包的引用*@
    <script src="~/Content/bootstrap-table/bootstrap-table.js"></script>
    <link href="~/Content/bootstrap-table/bootstrap-table.css" rel="stylesheet" />
    <script src="~/Content/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>

    <!-- Sweet Alert -->
    <link href="~/Content/css/plugins/sweetalert/sweetalert.css" rel="stylesheet">
    <link href="~/Content/css/animate.min.css" rel="stylesheet">
    <link href="~/Content/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <script src="~/Content/js/content.min.js?v=1.0.0"></script>
    <script src="~/Content/js/plugins/sweetalert/sweetalert.min.js"></script>
    <link href="~/Content/css/plugins/datapicker/datepicker3.css" rel="stylesheet" />
    <script src="~/Content/js/plugins/datapicker/bootstrap-datepicker.js"></script>
    <script src="~/Content/js/bootstrap.min.js"></script>
    <script src="~/Content/js/plugins/jasny/jasny-bootstrap.min.js"></script>

    <!--弹窗增改-->
    <link href="~/Content/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="~/Content/css/animate.min.css" rel="stylesheet">
    <script type="text/javascript" src="http://tajs.qq.com/stats?sId=9051096" charset="UTF-8"></script>
    <!--表单-->
    <link href="~/Content/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="~/Content/css/plugins/iCheck/custom.css" rel="stylesheet">
    <script src="~/Content/js/plugins/iCheck/icheck.min.js"></script>

    <!--文件上传-->
    <script src="/Content/js/plugins/prettyfile/bootstrap-prettyfile.js"></script>

    <script src="~/Content/js/plugins/layer/laydate/laydate.js"></script>

    <script src="~/Scripts/user/user.js"></script>

    <script src="~/Content/js/plugins/validate/jquery.validate.min.js"></script>
    <script src="~/Content/js/plugins/validate/messages_zh.min.js"></script>

    <script src="~/Scripts/user/User.Add.validate.js"></script>
</head>
<body>
    <div class="panel-body" style="padding-bottom:0px;">
        <div class="panel panel-default">
            <div class="panel-heading">查询条件</div>
            <div class="panel-body">
                <form id="formSearch" class="form-horizontal">
                    <div class="form-group" style="margin-top: 15px">
                        <div class="row">
                            <label class="col-sm-1 control-label">创建时间：</label>
                            <input class="form-control layer-date" style="float:left;width:240px;height:35px" autocomplete="off" placeholder="YYYY-MM-DD hh:mm:ss" onclick="laydate(start)" id="search_start" name="search_start">
                            <label style="float:left">&nbsp;_&nbsp;</label>
                            <input class="form-control layer-date" style="float:left;width:240px;height:35px" autocomplete="off" placeholder="YYYY-MM-DD hh:mm:ss" onclick="laydate(end)" id="search_end" name="search_end" min="search_start" aria-required="true">
                            <label class="control-label col-sm-1" for="searchStationType">状态:</label>
                            <div class="col-sm-1">
                                <select type="text" class="form-control" id="search_state">
                                    <option value="-1">全部</option>
                                    <option value="0">禁用</option>
                                    <option value="1">启用</option>
                                </select>
                            </div>
                            <label class="control-label col-sm-1" for="key">用户名称:</label>
                            <div class="col-sm-1">
                                <input type="text" class="form-control" id="search_keyword" name="search_keyword" title="关键字" placeholder="请输入关键字">
                            </div>
                            <div class="col-sm-1" style="text-align: left;">
                                <button type="button" style="margin-left: 50px" id="btn_query" class="btn btn-primary">查询</button>
                            </div>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div id="toolbar" class="btn-group">
            @if (ViewData["AuthorizeActions"].ToString().Contains("User-Add"))
            {
                <button id="btn_add" type="button" class="btn btn-default" data-toggle="modal">
                    <span class="glyphicon glyphicon-plus" aria-hidden="true"></span>新增用户
                </button>
            }
            @if (ViewData["AuthorizeActions"].ToString().Contains("User-Edit"))
            {
                <button id="btn_edit" type="button" class="btn btn-default" data-toggle="modal">
                    <span class="glyphicon glyphicon-pencil" aria-hidden="true"></span>修改用户
                </button>
            }
            </div>
        <table id="tb_user"></table>

        <!--添加弹窗-->
        <div class="modal inmodal fade" id="addBox" tabindex="-1" role="dialog" aria-hidden="true" style=" height: 800px">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title">添加用户</h4>
                    </div>
                    <div class="modal-body">
                        <!--表单信息-->
                        <div class="ibox-content">
                            <form method="post" class="form-horizontal" id="addForm" action="/User/AddUser">
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">所属角色：</label>
                                    <div class="col-sm-8">
                                        <select class="form-control" name="RoleId" id="RoleId">
                                            @foreach (var item in Model.data as List<Response_Role>)
                                            {
                                                <option value="@item.Id">@item.RoleName</option>
                                            }
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">用户账号：</label>
                                    <div class="col-sm-8">
                                        <input id="LoginAccount" name="LoginAccount" maxlength="40" minlength="2" type="text" class="form-control" required="" aria-required="true">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">用户密码：</label>
                                    <div class="col-sm-8">
                                        <input id="LoginPassword" name="LoginPassword" maxlength="40" minlength="2" type="text" class="form-control" required="" aria-required="true">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">用户姓名：</label>
                                    <div class="col-sm-8">
                                        <input type="text" id="Name" name="Name" maxlength="200" class="form-control" required="" aria-required="true">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">性别：</label>
                                    <div class="col-sm-8">
                                        <label>
                                            <input type="radio" checked="" value="1" id="sex1" name="Sex">男
                                        </label>
                                        <label>
                                            <input type="radio" value="0" id="sex2" name="Sex">女
                                        </label>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">出生日期：</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" id="Birth" name="Birth" placeholder="YYYY-MM-DD hh:mm:ss" onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" required="" aria-required="true">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">用户手机：</label>
                                    <div class="col-sm-8">
                                        <input type="text" id="Mobile" name="Mobile" maxlength="200" class="form-control" required="" aria-required="true">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">备注：</label>
                                    <div class="col-sm-8">
                                        <input id="Remark" type="text" class="form-control" maxlength="200" name="Remark">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-3">
                                        <button class="btn btn-primary" type="submit">提交</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <!--编辑弹窗-->
        <div class="modal inmodal fade" id="editBox" tabindex="-1" role="dialog" aria-hidden="true" style="height:800px">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
                        <h4 class="modal-title">编辑用户</h4>
                    </div>
                    <div class="modal-body">
                        <!--表单信息-->
                        <div class="ibox-content">
                            <form method="post" class="form-horizontal" id="editForm" action="/User/EditUser">
                                <input type="hidden" id="editId" name="editId" />
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">所属角色：</label>
                                    <div class="col-sm-8">
                                        <select class="form-control" name="editRoleId" id="editRoleId">
                                            @foreach (var item in Model.data as List<Response_Role>)
                                            {
                                                <option value="@item.Id">@item.RoleName</option>
                                            }
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">用户账号：</label>
                                    <div class="col-sm-8">
                                        <input id="editLoginAccount" name="editLoginAccount" maxlength="40" minlength="2" type="text" class="form-control" required="" readonly="readonly" aria-required="true">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">用户姓名：</label>
                                    <div class="col-sm-8">
                                        <input type="text" id="editName" name="editName" maxlength="200" class="form-control" required="" aria-required="true">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">性别：</label>
                                    <div class="col-sm-8">
                                        <label>
                                            <input type="radio" checked="" value="1" id="editsex1" name="editSex">男
                                        </label>
                                        <label>
                                            <input type="radio" value="0" id="editsex0" name="editSex">女
                                        </label>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">状态：</label>
                                    <div class="col-sm-8">
                                        <label>
                                            <input type="radio" checked="" value="1" id="editIsEnabled1" name="editIsEnabled">启用
                                        </label>
                                        <label>
                                            <input type="radio" value="0" id="editIsEnabled0" name="editIsEnabled">禁用
                                        </label>
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">出生日期：</label>
                                    <div class="col-sm-8">
                                        <input class="form-control" id="editBirth" name="editBirth" placeholder="YYYY-MM-DD " onclick="laydate({istime: true, format: 'YYYY-MM-DD'})" required="" aria-required="true">
                                    </div>
                                </div>

                                <div class="form-group">
                                    <label class="col-sm-3 control-label">用户手机：</label>
                                    <div class="col-sm-8">
                                        <input type="text" id="editMobile" name="editMobile" maxlength="200" class="form-control" required="" aria-required="true">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <label class="col-sm-3 control-label">备注：</label>
                                    <div class="col-sm-8">
                                        <input id="editRemark" type="text" class="form-control" maxlength="200" name="editRemark">
                                    </div>
                                </div>
                                <div class="form-group">
                                    <div class="col-sm-4 col-sm-offset-3">
                                        <button class="btn btn-primary" type="submit">提交</button>
                                    </div>
                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</body>
</html>
